#!/bin/bash
#
a= $(mysql -uroot -pWWW.1.com -e "show slave status\G" 2> /dev/null | grep "Slave_${1}_Running:" | awk '{print $2}')
if [ $a=="Yes" ]; then
 echo "IO线程：1"
else 
 echo "IO线程：0"
fi
b= $(mysql -uroot -pWWW.1.com -e "show slave status\G" 2> /dev/null | grep "Slave_${1}_Running:" | awk '{print $2}')
if [ $b=="Yes" ]; then
 echo "SQL线程：1"
else
 echo "SQL线程：0"
fi
